

package com.afteryuan.engine.model;
                
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.util.Date;

import com.afteryuan.dao.BaseObject;

@Entity
@Table(name = "T_CARTOON")
public class Cartoon extends BaseObject {
    public static Integer CREATOR_SYSTEM=0;//系统
    public static Integer CREATOR_USER=1;//用户

	private String id;
    private String name;
    private String config;
    private String description;
    /**
     * 创建者类型
     */
    private Integer creator=CREATOR_SYSTEM;
    /**
     * 人物拥有的动作数量
     */
    private Integer poseCount;
    private Long createTime;

    public Cartoon() {
        setCreateTime(new Date().getTime());
    }

    public Cartoon(String id) {
        this();
        this.id = id;
    }

    @Id
	@GeneratedValue(generator = "system-uuid")
	@GenericGenerator(name = "system-uuid", strategy = "uuid")
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getConfig() {
        return config;
    }

    public void setConfig(String config) {
        this.config = config;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Integer getPoseCount() {
        return poseCount;
    }

    public void setPoseCount(Integer poseCount) {
        this.poseCount = poseCount;
    }

    public Integer getCreator() {
        return creator;
    }

    public void setCreator(Integer creator) {
        this.creator = creator;
    }

    @Column(updatable = false)
    public Long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Long createTime) {
        this.createTime = createTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Cartoon that = (Cartoon) o;

        if (id != null ? !id.equals(that.id) : that.id != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        return id != null ? id.hashCode() : 0;
    }

    @Override
    public String toString() {
        return "Cartoon{" +
                "id='" + id + '\'' +
                ", name='" + name + '\'' +
                ", description='" + description + '\'' +
                ", poseCount=" + poseCount +
                ", createTime=" + createTime +
                '}';
    }
}